//
//  main.m
//  RandomPossessions
//
//  Created by Xie Yi on 12-7-22.
//  Copyright (c) 2012年 Free. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "Possession.h"

int main (int argc, const char * argv[])
{

//    @autoreleasepool {
//        
//        // insert code here...
//        NSLog(@"Hello, World!");
//        
//    }
    
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    NSMutableArray *items = [[NSMutableArray alloc] init];
    
//    [items addObject:@"One"];
//    [items addObject:@"Two"];
//    [items addObject:@"Three"];    
//    [items insertObject:@"Zero" atIndex:0];
//    
//    for(int i = 0;i < [items count];i++){
//        NSLog(@"%@",[items objectAtIndex:i]);
//    }
//    
//    Possession *p = [[Possession alloc] init];
//    [p setPossessionName:@"Red Sofa"];
//    [p setSerialNumber:@"A1B2C"];
//    [p setValueInDollars:100];
//    
//    
//    NSLog(@"%@ %@ %@ %d", [p possessionName],[p dateCreated],[p serialNumber],[p valueInDollars]);
//    
//    NSLog(@"%@", p);
    
    for(int i = 0;i < 10;i++){
        Possession *p = [Possession randomPossession];
        [items addObject:p];
    }
    
    for(int i = 0;i < [items count];i++){
        NSLog(@"-%@", [items objectAtIndex:i]);
    }
    
    for(Possession *item in items){
        NSLog(@"---%@", item);
    }
    
//    NSMutableArray *items2 = [[NSMutableArray alloc] init];
//    [items2 doSomethingWeird];
    
    
    
    [items release];
    items = nil;
    
    [pool drain];
    
    
    
    
    return 0;
}

